<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">
    <anchor :level="2" title="特性">特性</anchor>
</div>
<script charset="utf-8" src="../js/vue.min.js" type="text/javascript"></script>
<script id="anchor" type="text/x-template">
    <div>
        <h1 v-if="level===1">
            <a :href='#' +title>
                <slot></slot>
            </a>
        </h1>
        <h2 v-if="level===2">
            <a :href='#' +title>
                <slot></slot>
            </a>
        </h2>
        <h3 v-if="level=== 3">
            <a :href='#' +title>
                <slot></slot>
            </a>
        </h3>
        <h4 v-if="level===4">
            <a :href='#' +title>
                <slot></slot>
            </a>
        </h4>
        <h5 v-if="level===5">
            <a :href='#' +title>
                <slot></slot>
            </a>
        </h5>
        <h6 v-if="level===6">
            <a :href='#' +title>
                <slot></slot>
            </a>
        </h6>
    </div>
</script>
<script>
    Vue.component('anchor', {
        template: '#anchor',
        props: {
            level: {
                type: Number,
                required: true
            },
            title: {
                type: String,
                default: ''
            }
        }
    });

    var app = new Vue({
        el: '#app'
    })
</script>
</body>
</html>